<template>
  <div class="modal-overlay" @click="close">
    <div class="modal-content edit-index-modal" @click.stop>
      <EditIndex
        :index-name="indexName"
        :is-connected="isConnected"
        @close-modal="close"
        @index-updated="handleIndexUpdated"
      />
    </div>
  </div>
</template>

<script>
import EditIndex from '../EditIndex.vue';

export default {
  name: 'EditIndexModal',
  components: {
    EditIndex
  },
  props: {
    indexName: {
      type: String,
      required: true
    },
    isConnected: {
      type: Boolean,
      required: true
    }
  },
  methods: {
    close() {
      this.$emit('close');
    },
    handleIndexUpdated() {
      this.$emit('index-updated');
    }
  }
}
</script>